package com.dt.global.web.dao.linksquery.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.springframework.stereotype.Repository;

import com.dt.components.exhibernate.impl.HibernateDaoImpl;
import com.dt.global.entitys.bo.TWebLinks;
import com.dt.global.web.dao.Newscentrality.impl.NewscentralityImpl;
import com.dt.global.web.dao.linksquery.LinksQueryDao;

/**
 * 友情链接的查询的实现类
 * @author MWG
 *
 */
@SuppressWarnings("rawtypes")
@Repository
public class LinksQueryDaoImpl extends HibernateDaoImpl implements LinksQueryDao{
	private static final Logger LOG = Logger.getLogger(NewscentralityImpl.class);
	public List<TWebLinks> getTWebLinksQuery(String channelId)
			throws HibernateException {
		try {
			List<String> param = new ArrayList<String>();
		    String sql="from TWebLinks where channelId =? and isDisabled='Y' order by statDate ";
		    param.add(channelId);
			@SuppressWarnings("unchecked")
			List<TWebLinks> list = this.find(sql,param);
			return list;
		} catch (Exception e) {
			e.printStackTrace();
			LOG.error(e);
			return null;
		}
	}

}
